package com.itheima.utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import java.beans.PropertyVetoException;
import java.util.HashMap;
import java.util.Map;

public class Configuration {

    private ComboPooledDataSource dataSource = new ComboPooledDataSource();

    private Map<String, Mapper> mappers = new HashMap();

    public void setDriver(String driver) throws PropertyVetoException {
        dataSource.setDriverClass(driver);
    }

    public ComboPooledDataSource getDataSource() {
        return dataSource;
    }

    public void setUrl(String url) {
        dataSource.setJdbcUrl(url);
    }

    public void setUsername(String username) {
        dataSource.setUser(username);
    }

    public void setPassword(String password) {
        dataSource.setPassword(password);
    }

    public Map<String, Mapper> getMappers() {
        return mappers;
    }


}
